<template>
    <div class="app-container">
        <div class="search" v-if="$slots.conTop"><slot name="conTop"/></div>
        <div class="conCenter" v-if="$slots.conCenter"><slot name="conCenter"/></div>
        <div class="mianCon">
            <slot/>
        </div>
    </div>
</template>
<script>
export default {
    computed: {
        keepAliveRefresh() {
            return this.$store.state.tagsView.keepAliveRefresh
        },
        reGetData(){
            return this.$store.state.tagsView.reGetData
        }
    },
    activated(){
        this.reGetData && this.reGetData(()=>{this.$store.commit('tagsView/SET_REGETDATA','')})  // 刷新指定的数据,刷新完成后清空，防止下次进入页面刷新
        //console.log("reGetData",this.reGetData)
        //console.log("keepAliveRefresh",this.keepAliveRefresh)
        this.keepAliveRefresh && this.$emit('refresh')
    },
    created(){
        //console.log("slot：",this.$slots)
    }
}
</script>
<style lang="scss" scoped>
    .app-container{
        box-sizing:border-box;
        width: 100%;
        height: 100%;
        overflow: hidden;
        padding: 10px;
        overflow-y: auto;
        background: #f5f7fa;
        .search{
            margin: 0 0 10px 0;
            background: #fff;
            padding: 20px 20px 0 20px;
        }
        .mianCon{
            background: #fff;
            padding: 20px;
        }
        .conCenter{
            margin: 10px 0;
        }
    }
</style>